﻿using System;
using fastCSharp;
using fastCSharp.code.cSharp;

namespace diantou.dataModel.path
{
    /// <summary>
    /// 教程URL
    /// </summary>
    public struct tutorial
    {
        /// <summary>
        /// 教程标识
        /// </summary>
        public int Id;
        /// <summary>
        /// 
        /// </summary>
        public string Query
        {
            get { return "tutorialId=" + Id.toString(); }
        }
        /// <summary>
        /// 格式化URL
        /// </summary>
        /// <param name="path"></param>
        /// <returns></returns>
        private webView.hashUrl get(string path)
        {
            return new webView.hashUrl { Path = path, Query = Query };
        }
        /// <summary>
        /// 教程首页
        /// </summary>
        public webView.hashUrl Index
        {
            get { return get("/tutorial/index.html"); }
        }
        /// <summary>
        /// 参与用户列表
        /// </summary>
        public webView.hashUrl UserList
        {
            get { return get(userList); }
        }
        /// <summary>
        /// 通过用户列表
        /// </summary>
        public webView.hashUrl PassUserList
        {
            get { return new webView.hashUrl { Path = userList, Query = Query + "&isPass=1" }; }
        }
        /// <summary>
        /// 教程列表页
        /// </summary>
        internal const string List = "/tutorial/list.html";
        /// <summary>
        /// 用户列表
        /// </summary>
        private const string userList = "/tutorial/userList.html";
    }
}
